package com.atguigu.crowd.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author zzqstart
 * @Description
 * @date 2022-09-17 13:38
 */
@Configuration
public class CrowdWebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {

        // 目标视图名称
        String viewName = "member-reg";

        // 浏览器访问的路径
        String urlPath = "/auth/member/to/reg/page.html";

        // 添加视图控制器
        registry.addViewController(urlPath).setViewName(viewName);

        // 登录界面视图
        registry.addViewController("/auth/member/to/login/page").setViewName("member-login");
        // 登录后个人中心
        registry.addViewController("/auth/member/to/center/page").setViewName("member-center");
        registry.addViewController("/member/my/crowd").setViewName("member-crowd");
    }

}
